package com.ruoyi.customer.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.StringUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 客户信息对象 customer
 *
 * @author aef
 * @date 2022-11-27
 */
@TableName("customer")
@Setter
@Getter
@ToString
public class CustomerInfo extends BaseEntity {
    //开业
    private static final long MANAGEMENT_FORMS_STATUS_STAR_BUSINESS = 0;
    //破产
    private static final long MANAGEMENT_FORMS_STATUS_GO_BROKE = 2;
    //注销
    private static final long MANAGEMENT_FORMS_STATUS_WRITE_OFF = 1;
    //北京
    private static final long AFFILIATING_AREA_BEI_JING = 0;
    //上海
    private static final long AFFILIATING_AREA_SHANG_HAI = 1;
    //广东
    private static final long AFFILIATING_AREA_GUANG_DONG = 1;

    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    @TableId(type = IdType.AUTO)
    @TableField("id")
    private Long id;

    /** 企业名称 */
    @Excel(name = "企业名称")
    @TableField("customer_name")
    private String customerName;

    /** 法定代表人 */
    @Excel(name = "法定代表人")
    @TableField("legal_leader")
    private String legalLeader;

    /** 成立日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "成立日期", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("register_date")
    private Date registerDate;

    /** 经营状态 */
    @Excel(name = "经营状态")
    @TableField("open_state")
    private Integer openState;

    /** 所属地区 */
    @Excel(name = "所属地区")
    @TableField("province")
    private Long province;

    /** 注册资本 */
    @TableField("reg_capital")
    private BigDecimal regCapital;

    /** 所属行业 */
    @Excel(name = "所属行业")
    @TableField("industry")
    private String industry;

    /** 经营范围 */
    @TableField("scope")
    private String scope;

    /** 注册地址 */
    @TableField("reg_addr")
    private String regAddr;

    /** 录入时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "录入时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @TableField("input_time")
    private Date inputTime;

    /** 录入人 */
    @Excel(name = "录入人")
    @TableField("input_user")
    private String inputUser;

    @TableField(exist = false)
    private String keyword;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date endInputTime;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date beginInputTime;

    public void setKeyword(String keyword) {
        if (!StringUtils.isNotEmpty(keyword)){
            this.keyword = null;
        }
        this.keyword = keyword;
    }

}
